package com.example4;

public class ProtectTheBandTest2 {
    public static void main(String[] args) {
        MyDaemon m = new MyDaemon();
        m.setDaemon(true);
        m.start();
        for (int i = 1; i <= 5; i++) {
            System.out.println("main:"+i);

        }
    }
}

class MyDaemon extends Thread{
    @Override
    public void run() {
        while (true){
            System.out.println("我一直守护者着你.......");
            try {
                Thread.sleep(1);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }

    }

}
